//
//  MDAdViewController.swift
//  MDSplashScreen_Example
//
//  Created by Alan on 2018/1/11.
//  Copyright © 2018年 CocoaPods. All rights reserved.
//

import UIKit
import WebKit

class MDAdViewController: UIViewController {

    var url:String?
    lazy var webView:WKWebView = {
        let webview = WKWebView.init(frame: self.view.frame)
        webview.navigationDelegate = self
        self.view.addSubview(webview)
        return webview
    }()
    override func viewDidLoad() {
        super.viewDidLoad()
        self.title = "正在加载。。。"
        webView.load(URLRequest.init(url: URL.init(string: url!)!))
        
        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

}

extension MDAdViewController:WKNavigationDelegate{
    func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
        self.title = webView.title!
    }
}
